<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('Enve/tctList')}">讨彩头列表</a></li>
		</ul>
        <form class="well form-search" method="post" action="{:U('Enve/tctList')}">
			关键字:
            <input type="text" name="keywork" style="width: 200px;" value="{:I('request.keywork/s','')}" placeholder="用户id/用户名/">
            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-danger" href="{:U('Enve/index')}">清空</a>
        </form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th>ID</th>
					<th>用户id</th>
					<th>用户名称</th>
					<th>头像</th>
					<th>内容</th>
					<th>赞赏总次数</th>
					<th>赞赏总金额</th>
					<th>创建时间</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="enves" item="vo">
				<tr>
					<td class="enveid">{$vo.id}</td>
					<td>{$vo.user_id}</td>
					<td>{$vo.nick_name}</td>
					<td><a class="img-show" href="javascript:" attr-img="{$vo.head_img}"><img width="30" height="30" src="{$vo.head_img}"/></a></td>
					<td>{$vo.content}</td>
					<td>{$vo.num}</td>
					<td>{$vo.amount}</td>
					<td>{$vo.add_time}</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
		$('.img-show').on('click',function(){
		   var img_src = $(this).attr('attr-img');
		   console.log(img_src);
            //页面层-自定义
            layer.open({
                type: 1,
                title: false,
                closeBtn: 0,
                shadeClose: true,
                skin: 'yourclass',
                content: '<img src="'+img_src+'"/>'
            });
		})

		$('.remove-from-enve').on('click', function() {
		    var enveid = $(this).parents('tr').find('.enveid').text();
			$.post("{:U('Enve/removeEnve')}", {'id':enveid}, function ($data) {
				alert($data.msg);
			});
		})
	</script>
</body>
</html>
